package com.dobby.logger.utils;

import com.google.common.collect.Maps;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by lgq on 2015/6/9.
 */
public class RedisLogUtils {

    private static final String SOLR_HASH_KEY = "solrCfg";
    private static final String CASSANDRA_HASH_KEY = "cassandraCfg";

    public static Map<String,String> getSolrProps() {
        Map<String, String> solrCfgMap = Maps.newHashMap();
        solrCfgMap.put("solr.url",CommonUtils.findProperties("cassandra.properties").getProperty("solr.url"));
        solrCfgMap.put("solr.syslogInstance",CommonUtils.findProperties("cassandra.properties").getProperty("solr.syslogInstance"));
        solrCfgMap.put("solr.slowqueryInstance",CommonUtils.findProperties("cassandra.properties").getProperty("solr.slowqueryInstance"));
        return solrCfgMap;
    }


    public static Map<String,String> getCassandraProps() {
        Map<String, String> cassandraCfgMap = Maps.newHashMap();
        cassandraCfgMap.put("cluster.name",CommonUtils.findProperties("cassandra.properties").getProperty("cluster.name"));
        cassandraCfgMap.put("cluster.hosts",CommonUtils.findProperties("cassandra.properties").getProperty("cluster.hosts"));
        cassandraCfgMap.put("cassandra.keyspace",CommonUtils.findProperties("cassandra.properties").getProperty("cassandra.keyspace"));
        cassandraCfgMap.put("cassandra.syslogColumnFamily",CommonUtils.findProperties("cassandra.properties").getProperty("cassandra.syslogColumnFamily"));
        cassandraCfgMap.put("cassandra.slowqueryColumnFamily",CommonUtils.findProperties("cassandra.properties").getProperty("cassandra.slowqueryColumnFamily"));
        return cassandraCfgMap;
    }


}
